#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time:2020/10/31 5:29 下午
# @Author:boyizhang

from pydantic import BaseModel
from typing import Optional,List
from datetime import  datetime

from enum import Enum,unique
@unique
class Status(Enum):
    todo = "todo"
    doing = "进行中"
    done = "已完成"
    block = "阻塞"
    # def __repr__(self):
    #     return
    active = "active"

class CreateProject(BaseModel):
    project_name: str
    address: str
    boss_name: str
    contacts: str
    total_fees: Optional[float] = 0
    wages: Optional[float] = 0
    decription: str


class Project(CreateProject):
    '''
    创建，

    '''
    project_id: int
    end_time: Optional[datetime] = None
    start_time:datetime = datetime.now()
    status: str
    is_delete:int = 0
    class Config:
        orm_mode = True

class CreateUser(BaseModel):
    user_name: str
    type_id: int
    phone_number: str

class User(CreateUser):
    user_id: int
    status: int
    class Config:
        orm_mode = True

class CreateUserType(BaseModel):
    type_name: str
    rate: float

class UserType(CreateUserType):
    type_id: Optional[int]
    class Config:
        orm_mode = True


if __name__ == '__main__':
    # status =
    print(Status.doing.value)



